<!DOCTYPE html>
<!--[if IE 9]>         <html class="no-js lt-ie10" lang="en"> <![endif]-->
<!--[if gt IE 9]><!-->
<html class="no-js" lang="en">
	<!--<![endif]-->

	<head>
		<meta charset="utf-8">

		<title>登录——人员管理系统</title>

		<meta name="description" content="AppUI is a Web App Bootstrap Admin Template created by pixelcave and published on Themeforest">
		<meta name="author" content="pixelcave">
		<meta name="robots" content="noindex, nofollow">

		<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">

		<!-- Icons -->
		<!-- The following icons can be replaced with your own, they are used by desktop and mobile browsers -->
		
		<!-- Stylesheets -->
		<!-- Bootstrap is included in its original form, unaltered -->
		<link rel="shortcut icon" href="images/title.jpg">
		<link rel="stylesheet" href="css/bootstrap.min.css" />

		<!-- Related styles of various icon packs and plugins -->
		<link rel="stylesheet" href="css/plugins.css" />

		<!-- The main stylesheet of this template. All Bootstrap overwrites are defined in here -->
		<link rel="stylesheet" href="css/mains.css" />

		<!-- Include a specific file here from css/themes/ folder to alter the default theme of the template -->

		<!-- The themes stylesheet of this template (for using specific theme color in individual elements - must included last) -->
		<link rel="stylesheet" href="css/themes/amethyst.css" />
		<link rel="stylesheet" href="css/font-awesome.min.css" />
		<link rel="stylesheet" href="layui/css/layui.css" media="all" />
		<!-- END Stylesheets -->

		<!-- Modernizr (browser feature detection library) -->
		<script type="text/javascript" src="js/vendor/modernizr-3.3.1.min.js" ></script>
	</head>

	<body>
		<!-- Login Container -->
		<div id="login-container">
			<!-- Login Header -->
			<h1 class="h2 text-light text-center push-top-bottom animation-slideDown">
                 <strong>Welcome to 人道</strong>
            </h1>
			<!-- END Login Header -->

			<!-- Login Block -->
			<div class="block animation-fadeInQuickInv">
				<!-- Login Title -->
				<div class="block-title">
					<div class="block-options pull-right">
						<!--<a href="page_ready_reminder.html" class="btn btn-effect-ripple btn-primary" data-toggle="tooltip" data-placement="left" title="忘记密码?"><i class="fa fa-exclamation-circle"></i></a>-->
						<!--<a href="page_ready_register.html" class="btn btn-effect-ripple btn-primary" data-toggle="tooltip" data-placement="left" title="Create new account"><i class="fa fa-plus"></i></a>-->
					</div>
					<h2>登录</h2>
				</div>
				<!-- END Login Title -->

				<!-- Login Form -->
				<form id="form-login" class="form-horizontal">
					<div class="form-group">
						<div class="col-xs-12">
							<input type="text" id="login-email" name="login-email" class="form-control" placeholder="账号" style="margin-bottom: 5px;margin-left:50px;">
							
						</div>
					</div>
					<div class="form-group">
						<div class="col-xs-12">
							<input type="password" id="login-password" name="login-password" class="form-control" placeholder="密码" style="margin-top: 10px;margin-left:50px;">
							
						</div>
					</div>
					<div id="errormsg" style="color: #FF0000;margin-left: 15%;"></div>
					<div class="form-group form-actions" style="background-color: #FFFFFF;border: none;">
						
						<div>
             			    <a href="javascript:;" style="float: left;margin-left: -160px;"onclick="pop();">登录遇到问题</a>
							<button type="button"class="btn  btn-sm btn-primary" onclick="login()"style="background-color:#725dc0 ;float:right;background-image: linear-gradient(to bottom,#7c62ad,#7e64ae);">登录</button>
						</div>
					</div>
				</form>
				<!-- END Login Form -->

			</div>
			<!-- END Login Block -->

			<!-- Footer -->
			<!--<footer class="text-muted text-center animation-pullUp">
                <small><span id="year-copy"></span> &copy; <a href="http://goo.gl/RcsdAh" target="_blank">AppUI 2.7</a></small>
            </footer>-->
			<!-- END Footer -->
		</div>
		<!-- END Login Container -->
		

		<!-- jQuery, Bootstrap, jQuery plugins and Custom JS code -->
		<script type="text/javascript" src="js/vendor/jquery-2.2.4.min.js" ></script>
		<script type="text/javascript" src="js/vendor/bootstrap.min.js" ></script>
		<script type="text/javascript" src="js/plugins.js" ></script>
		<script type="text/javascript" src="js/app.js" ></script>
		<script type="text/javascript" src="layui/layui.js"></script>
		

		<!-- Load and execute javascript code used only in this page -->
		<!--<script src="js/pages/readyLogin.js"></script>-->
		<script>
			var configJson='config.json'
			$.getJSON(configJson,function(data){
				ip=data.urlip;
			})
			var ip;
				loginUrl = '/login';

			function pop(){
				layui.use('layer', function(){
  					var layer = layui.layer;
  				  	layer.alert('手机号：18758263422(543422)<br>微信：    F_10086_<br>邮箱：   13677294433@163.com', {
  						skin: 'layui-layer-molv' ,
  						title:'请联系我们',
  						closeBtn: 0
					});
				});
			}
			
			function login() {
				username=$('#login-email').val();
				password1=$('#login-password').val();
				$.ajax({
					type: "post",
					url: ip+loginUrl,
					data: JSON.stringify({
						"username": username,
						"password": password1
					}),
					async: true,
					dataType: "json",
					contentType: "application/json",
					xhrFields: {
						withCredentials: true
					},
					crossDomain: true,
					success: function(res) {
						if(res.code == 0) {
							 window.location.href="personnel.html";
						}
						if(res.code==-1){
							
							$("#errormsg").html("登录信息错误请再次填写！");
							console.log(res.msg);
						}
					},
					Error: function() {
						alert("服务器出错");
					}
				});

			}
		</script>
	</body>

</html>